home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
assemblr
/
library
/
asm32
/
source.doc
< prev
next >
Wrap
Text File
|
1994-01-09
|
21KB
|
602 lines
SOURCE.DOC Copyright (C) 1993 Douglas Herr ■ all rights reserved
ASM32 uses a number of subroutines which are not applicable to general
programming. These subroutines include "$" in their names.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$clip: clip a line to fit within graphics view area
Source: $clip.asm ($graph.asm)
Call with: call from ASM32 line drawing subroutines
Returns: x & y coordinates in DRAWLINE data area within view area
Uses: AX, BX, CX, DX, DI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$ega16: update EGA/VGA/SVGA registers for given drawmode & color
Source: $ega16.asm ($graph.asm)
Call with: no parameters
call $graph before calling $ega16
drawmode & gcolor must be current
Returns: DX = 3CEh (Graphics Controller data register address)
Uses: DX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$fget: read more data into file buffer
Source: $fget.asm
Call with: BX = file handle
ES = buffer segment address
Returns: DF = 0
if CF = 0, AX = bytes read from file
if CF = 1, AX = DOS error code
Uses: AX, DX, SI, DS, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$gbytes: calculate byte size of graphics screen
Source: $gbytes.asm ($graph.asm)
Call with: no parameters
$graph must be called before calling $gbytes
Returns: EAX = byte size of screen
Uses: EAX
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$getdot: determines pixel status (graphics modes)
Source: $getdot.asm ($graph.asm)
Call with: AX = x-coordinate, BX = y-coordinate
ES = segment address of screen buffer
all $graph data must be current
Returns: AX = pixel value
Uses: AX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$gp00, $gp02, $gp06, $gp08, $gp10: GPrint/GPrintX code for various dottypes
Source: $gp00.asm, $gp02.asm, $gp06.asm $gp08.asm, $gp10.asm
(banks.asm, $ytable.asm)
Call with: called from GPrint or GPrintX subroutines
DS:[SI] -> character font definition
ES = segment address of screen buffer
Returns: nothing
prints a character on graphics screen
Uses: AX, BX, CX, DX, DI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$gpick: select string from fixed-field string block; graph mode
Source: $gpick.asm (heap.asm, strncpy.asm, drawbox.asm, fillbox.asm,
gprint.asm, dosalloc.asm, bitblock.asm, bbbytes.asm,
strlen.asm, gcolor.asm, $menu.asm, $graph.asm, m$input.asm,
v$extkey.asm, m$chrn.asm, m$nkey.asm)
Call with: ES = segment address of string list
AX = number of strings
CX = field size
BX = initial choice
DS:[DX] pointing to upper left screen coordinates
assumes DS:DGROUP
Returns: AX = returning keycode
BX = returned selection number
Uses: AX, BX, CX, DX, SI, DI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$graph: set up screen parameters for all ASM32 graphics modes
Source: $graph.asm (gcolor.asm, $ytable.asm)
Call with: no parameters
system must be in graphics mode you intend to use
Returns: nothing
updates $graph data: view coordinates
x-limit
y-limit
base segment address
page size
byte width of screen
maximum page number
dot type: 0 = CGA 4-color
2 = monochrome
(CGA, Herc, ATT, mode 11h)
4 = Hercules InColor
6 = EGA/VGA 16-color & monochrome
SVGA16 (up to 800x600)
8 = mode 13h 256-color
10 = VGA13X
12 = SVGA16 (over 800x600)
14 = SVGA256
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$h8x8: copies standard 8x8 character definition to 0B400:0000
for Hercules RamFont modes
Source: $h8x8.asm (f8x8.asm)
Call with: no parameters; assumes Hercules RamFont card is installed
Returns: nothing
Uses: nothing; all registers and flags are saved
Used by: HRam9043, HRam8043
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$h8x12: copies standard 8x12 character definition to 0B400:0000
for Hercules RamFont modes
Source: $h8x12.asm ($rld.asm, f8x12rle.asm)
Call with: no parameters; assumes Hercules RamFont card is installed
Returns: nothing
Uses: nothing; all registers and flags are saved
Used by: HRam9029, HRam8029
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$handle: verify handle for buffered file I/O
Source: fopen.asm
Call with: BX = file handle
ASSUMES DS:DGROUP
Returns: if CF = 0, SI points to file handle in ASM32 buffer data area
segment address of buffer associated with this handle
at 2[SI]
if CF = 1, handle in BX not managed by ASM32 buffer system
Uses: SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$herc: detects Hercules-compatible equipment; does not determine
if Hercules equipment is the default monitor (see IsHerc)
Source: $herc.asm
Call with: no parameters
Returns: if CF = 1, no Hercules-compatible equipment installed
if CF = 0, AX = Hercules model
128 = Hercules Graphics Card or compatible
144 = Hercules Graphics Card Plus
208 = Hercules InColor card
Uses: EAX, CF
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$herc16: update InColor registers for given drawmode & color
used only by dottype 4 in graphics modes
Source: $herc16.asm ($graph.asm)
Call with: no parameters
call $graph before calling $herc16
drawmode & gcolor must be current
Returns: EBX = ABS(drawmode) shl 2
Uses: EBX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$hislope: draw a high-slope line
Source: $hislope.asm ($ega16.asm, $herc16.asm, $vga256.asm,
$hipatrn.asm, banks.asm, $graph.asm, dotmask.asm)
Call with: ES = screen buffer segment
x0 = [EBP-2]
y0 = [EBP-4]
x1 = [EBP-6]
y1 = [EBP-8]
Returns: nothing
Uses: AX, BX, CX, DX, DI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$horiz: draw horizontal line
Source: $horiz.asm ($ega16.asm, $herc16.asm, $vga256.asm, $hvpatrn.asm
banks.asm, $graph.asm, dotmask.asm)
Call with: ES = screen buffer segment
x0 = [EBP-2]
y0 = [EBP-4]
x1 = [EBP-6]
y1 = [EBP-8]
Returns: nothing
Uses: AX, BX, CX, DX, DI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$hipatrn: draw a high-slope line with pattern
called from $hislope
Source: $hipatrn.asm
$hpattern: draw a horizontal line with pattern
called from $horiz
Source: $hvpatrn.asm
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
a$putw: module used by several ASM32 text subroutines to copy
a character/attribute pair to a window of the screen;
includes snow control logic for CGA systems.
Source: a$putw.asm
Call with: ECX = column width of window
DX = 0 to disable snow control
= 3DAh to enable snow control (COLOR monitors only!!)
SI = row height of window
EDI points to video buffer
AL = character
AH = color attribute
BX = bytes per screen row (80-column screen has 160 bytes per row)
DF = 0 (clear direction flag with CLD)
Uses: EDI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
a$paint: used to change color of the screen; used by Paint and
WPaint subroutines. Includes snow control logic for CGA
systems.
Source: a$paint.asm
Call with: ES:[DI] pointing to screen
CX = number of columns
SI = number of rows
AH = color attribute
DX = 3DAh for CGA snow control, 0 otherwise
BP = bytes per screen row
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
a$recolor: replaces selected screen color; used by ReColor and
WReColor subroutines. Includes snow control logic for CGA
systems.
Source: a$recolor.asm
Call with: ES:[DI] pointing to screen
AL = oldcolor
AH = newcolor
DX = 0 or 3DAh for snow control
SI = number of rows
CX = number of columns
BP = bytes per screen row
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$wdata: parameter manager for ASM32's text-mode window subroutines.
Source: $wdata.asm (crtinfo.asm)
Call with: EBX pointing to widow corner data
requires 4 bytes available at [ebp-4]
row0 equ [ebx]
col0 equ 2[ebx]
row1 equ 4[ebx]
col1 equ 6[ebx]
Returns: SI = number of rows
ECX = number of columns
DX = 0 if no CGA, 3DAh if CGA and "snow" control not disabled
[ebp-4] = bytes per screen row
EDI -> [row0, col0] on screen
Uses: ECX, DX, EDI, SI, [EBP-4], flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$rlbytes: calculates bytes required to decode run-length encoded data
Source: $rlbytes.asm
Call with: DS:[SI] pointing to encoded data
CX = size of encoded data block
Returns: AX = bytes required to decode data block
Uses: AX
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$rld: decodes run-length encoded data
Source: $rld.asm
Call with: DS:[SI] pointing to encoded source data
ES:[DI] pointing to destination buffer
CX = number of encoded bytes
assumes destination buffer is large enough for decoded data
Returns: nothing
Uses: nothing
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$rle: run-length encoding data compression
Source: $rle.asm
Call with: DS:[SI] pointing to data to be encoded
ES:[DI] pointing to output buffer
CX = number of bytes to encode
assumes output buffer is at least the same size as input data
Returns: DF = 0
if CF = 0, AX = encoded data size
if CF = 1, run-length encoding will not compress file
data in output buffer is incomplete
Uses: AX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$strstr: string search module used by several ASM32 subroutines
Source: $strstr.asm
Call with: [EDI] -> search string, [ESI] -> pattern string
EBX = pattern string length, EDX = search string length
$strstr searches for the first occurrance of the pattern
string in the search string
Returns: if CF = 1, no match
if CF = 0, EAX = match offset from ES:[EDI]
Uses: EAX, EBX, ECX, EDX, ESI, EDI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$wcopy: copies word data from one portion of memory to another;
intended for copying to/from video memory in text mode
includes snow control logic for CGA systems.
Source: $wcopy.asm
Call with: ECX = words to copy
ESI -> source
EDI -> destination
DX = CRTC status port if CGA, else 0
DF = 0 or 1
Returns: EDI pointing past end of destination
ESI pointing past end of block
ECX = 0
Uses: AX, ECX, EDI, ESI, flags
Called by: WSave, WRestore, GetScreen, PutScreen, TCopy, VScroll, HScroll
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
m$putwindow: save screen, clear window & print window frame
Source: m$putw.asm (wsize.asm, wsave.asm, dosalloc.asm, wframe.asm,
wclear.asm)
Call with: DS:[BX] pointing to window corner data
Returns: ES = segment address of saved screen area
Uses: ES, flags
Called by: PICKSTR
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$strlist: copy group of ASCIIZ strings to block of fixed-length strings
source: $strlist.asm (heap.asm, strlen.asm)
Call with: ESI pointing to first string to copy
ECX = minimum field size
string group terminated with double NUL
requires sufficient free DOS memory
Returns: if CF = 1, insufficient DOS memory available
if CF = 0:
EDI = base address of string block
EAX = number of strings
ECX = string field size
Uses: EAX, ECX, EDI, flags
Called by: PICKSTR, GPICKSTR
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
m$nkey: process normal keystroke for menu subroutines
Source: m$nkey.asm (isupper.asm, m$chr.asm)
Call with: AL = key code
BX = initial cursor position
CX = field width
DX = number of menu choices
ES:[DI] pointing to first menu choice
Returns: BX = output position
if CF = 0, found matching character
if CF = 1, no match
Uses: AX, BX, CX, DX, DI, flags
Called by: $tpick
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
m$chr: determines if a keycode is the first uppercase character
in a string
Source: m$chr.asm (strlen.asm)
Call with: AX = keycode
DS:[EBX] pointing to string
Returns: if CF = 1, string length = 0
if CF = 0:
ECX = 0 if no upper case characters in the string
if ECX <> 0, AH = first UCASE character
ZF = 1 if character is first ucase in string
DS:[WBX] points to first ucase character
Uses: AX, EBX, ECX, flags
Called by: $tpick, PULLDOWN
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
v$extkey: extended keycode processor for ASM32 vertical list menus
(text and graph modes)
Source: v$extkey.asm
Call with: AL = low word of ASM32 extended key code
[EBP-2] = field width of string list
[EBP-4] = number of choices
[EBP-6] = current choice
[EBP-8] = first string to print (for scrolling if required)
[EBP-10] = number of strings to print
( = number of choices if no scrolling required)
Returns: if CF = 0, modifies [EBP-6] and [EBP-8]
if CF = 1, keycode not a valid cursor movement key
valid keys: Up, Down, Home, End, PgUp, PgDown
Uses: AX, flags
Called by: $pick, $gpick
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
FIND_CGA: determine if color monitor is installed
FIND_MDA: determine if monochrome monitor is installed
Source: $6845.asm
Call with: no parameters
Returns: if CF = 0, monitor is installed
if CF = 1, monitor is not installed
Uses: flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$ytable: calculate buffer offset for each row of screen
used to set up for dottype 0 - 4 graphics modes
Source: $ytable.asm ($herc.asm)
Call with: AX = 0
ES:[DI] pointing to YTABLE data area
CX = ylimit+1
DF = 0
Returns: nothing
Uses: AX, BX, CX, DX, DI
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
a$mname: return month or day name to calling program
used by MONTHNAME and DAYNAME
Source: a$mname.asm
Returns: ES:[BX] -> month name string
CX = string length
Uses: ES, BX, CX
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$vga256: determine color & machine code for given drawmode
Source: $vga256.asm ($graph.asm)
Call with: no parameters
call $graph before calling $vga256
drawmode & gcolor must be current
Returns: AL = color
DL = machine code
DH = ABS(drawmode)
Uses: AX, DX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$reset: restores default hardware settings for graphics modes
used as part of exit code from ASM32 graphics subroutines
Source: $reset.asm ($graph.asm)
Call with: no parameters
Returns: nothing
Uses: nothing
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$putdot: updates a pixel on graphics screen
Source: $putdot.asm ($graph.asm, $herc16.asm, banks.asm, dotmask.asm)
Call with: AX = x-coordinate, BX = y-coordinate
all $graph data must be current
Returns: nothing
Uses: flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$rotate: rotates character font for GPrint & GPrintX
Source: $gp.asm
Call with: [ESI] pointing to unrotated font
Returns: [ESI] pointing to new charcter font on stack
Uses: ESI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$vert: draw vertical line
Source: $vert.asm ($ega16.asm, $herc16.asm, $vga256.asm, $hvpatrn.asm
banks.asm, $graph.asm, dotmask.asm)
Call with: ES = screen buffer segment
x0 = [EBP-2]
y0 = [EBP-4]
x1 = [EBP-6]
y1 = [EBP-8]
Returns: nothing
Uses: AX, BX, CX, DX, DI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$loslope: draw a low-slope line
Source: $loslope.asm ($ega16.asm, $herc16.asm, $vga256.asm,
$lopatrn.asm, banks.asm, $graph.asm, dotmask.asm)
Call with: ES = screen buffer segment
x0 = [EBP-2]
y0 = [EBP-4]
x1 = [EBP-6]
y1 = [EBP-8]
Returns: nothing
Uses: AX, BX, CX, DX, DI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
m$input: input module for ASM32 menu subroutines
Source: m$input.asm (kifwait.asm, $flags.asm)
Call with: no parameters
Returns: AX = keycode
BX = mouse buttons pressed
mouse motion is returned as a Left, Right, Up or Down
keycode. IsMouse must be called before the menu subroutine
to enable mouse functions.
Uses: AX, BX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$lopatrn: draw a low-slope line with pattern
called from $loslope
Source: $lopatrn.asm
$vpattern: draw a vertical line with pattern
called from $vert
Source: $hvpatrn.asm